﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<%@ Register TagPrefix="alicmsUC" TagName="Ime" Src="../../ime.dwt.ascx"%>
<%@ Register TagPrefix="alicmsUC" TagName="LanguageMenu" Src="../../language_menu.dwt.ascx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<ali:Get ID="Rule" Object="Rule" InnerID="Request.QueryString['ID']" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>导出配置</title>
<link rel="stylesheet" type="text/css" href="<%=CommonPath%>jquery/themes/lightness/all.css" />
<ali:Comment><link rel="stylesheet" type="text/css" href="../../S01/CHS/css/common.css" /></ali:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" />
<alicmsUC:Ime Ime="true" Eot="true" runat="server" />
<script language="c#" runat="server">
protected XmlDocument _config;
protected XmlDocument Config
{
	get
	{
		if (_config == null && Rule[Alias.Rule.Config].ToString() != String.Empty)
		{
			_config = new XmlDocument();
			_config.LoadXml(Rule[Alias.Rule.Config].ToString());
		}
		
		return _config;
	}
}

protected DataTable _fields;
protected DataTable Fields
{
	get
	{
		if (_fields == null)
		{
			_fields = new DataTable();
			_fields.Columns.Add("Name", typeof(string));

			if (Config != null)
			{
                XmlNodeList fieldNodes = Config.DocumentElement.SelectNodes("Fields/Field");
                foreach (XmlNode fieldNode in fieldNodes)
                {
                    if (fieldNode.Attributes["Name"] == null)
                        continue;

					DataRow row = _fields.NewRow();
                    row["Name"] = fieldNode.Attributes["Name"].Value;
					_fields.Rows.Add(row);
                }
			}
		}
		
		return _fields;
	}
}

protected string Export
{
	get
	{
		if (Config == null)
			return String.Empty;
		
		XmlNode exportNode = Config.DocumentElement.SelectSingleNode("Export");
		if (exportNode == null)
			return String.Empty;
		else
			return exportNode.OuterXml;
	}
}
</script>
<style type="text/css">
td .Table1{margin:0;width:460px;background:#FFF}
td .Table1 thead th{text-align:center}
td .Table1 tbody td{padding:0;text-align:center}
</style>
<script type="text/javascript">
var _page = "rule_export";
var _lang = "<%=ContentLang%>";
var _webPath = "<%=WebPath%>";
var _imagePath = "<%=ImagePath%>";
var _id = "<%=Request.QueryString["ID"]%>";
var _export = "<%=Manager.Escape(Export)%>";

var _operations = ["=",">","<",">=","<=","<>"];
var _properties = [];
var _fields = [];
<ali:List Source="Fields">
	<ali:Record>
		_fields[_fields.length] = "<%=[0]%>";
	</ali:Record>
</ali:List>

var _lang_working = "正在操作...";
var _lang_operation_fail = "操作失败！";
var _lang_operation_success = "操作成功！";
var _lang_delete = "删除";
var _lang_module_empty = "请选择模块！";
var _lang_object_empty = "请选择对象！";
</script>
</head>
<body>
<div class="WhiteHeader">
	<div class="Left"><img src="<%=ImagePath%>close_frame.gif" /></div>
	<div class="Title"><a href="../rule/list.aspx?Lang=<%=ContentLang%>">规则列表</a> → <span class="<%=ContentLang%>Font"><%=Rule[Name]%></span></div>
	<div class="Right">
		<alicmsUC:LanguageMenu runat="server" />
		<img height="15" src="<%=ImagePath%>dropdown.gif" /> 语言：<%=CurrentLanguage%>
	</div>
</div>
<div class="Block">
	<ul class="TabMenu">
		<li class="Left"></li>
		<li class="Middle"><a href="../rule/edit.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ID"]%>">编辑</a></li>
		<li class="Right"></li>
		<li class="Left Selected"></li>
		<li class="Middle Selected">导出配置</li>
		<li class="Right Selected"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../rule/result/list.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ID"]%>">结果</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../rule/result/replace.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["ID"]%>">批量替换</a></li>
		<li class="Right"></li>
	</ul>
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle"></li>
		<li class="Right"></li>
	</ul>
	<form>
		<table border="0" cellpadding="4" cellspacing="1">
			<tfoot>
				<tr>
					<td colspan="2"><input type="submit" class="Button" value="保存" /></td>
				</tr>
			</tfoot>
			<tbody>
				<tr>
					<th width="120">目标对象：</th>
					<td>
						<ali:List Mark="System" Object="Module">
							模块：<select name="Module">
								<ali:Record>
									<option value="<%=ID%>" Namespace="<%=Namespace%>"><%=Name%></option>
								</ali:Record>
							</select>
						</ali:List>
						实例：<select name="Instance">
							<option value="">-- 未指定 --</option>
						</select>
						对象：<select name="Object">
							<option value="">-- 未指定 --</option>
						</select>
					</td>
				</tr>
				<tr>
					<th>字段映射：</th>
					<td>
						<table border="0" cellpadding="4" cellspacing="1" class="Table1">
							<thead>
								<tr>
									<th>源字段</th>
									<th>目标属性</th>
									<th width="60">唯一</th>
									<th width="60">只做映射</th>
									<th width="60">删除</th>
								</tr>
							</thead>
							<tfoot>
								<tr>
									<td colspan="5"><button type="button" id="Map">添加</button></td>
								</tr>
							</tfoot>
							<tbody>
							</tbody>
						</table>
					</td>
				</tr>
				<tr>
					<th>停止条件：</th>
					<td>
						<table border="0" cellpadding="4" cellspacing="1" class="Table1">
							<thead>
								<tr>
									<th>字段</th>
									<th width="60">操作</th>
									<th>取值</th>
									<th width="60">删除</th>
								</tr>
							</thead>
							<tfoot>
								<tr>
									<td colspan="4"><button type="button" id="Condition">添加</button></td>
								</tr>
							</tfoot>
							<tbody>
							</tbody>
						</table>
						1）取值可以空。<br />
						2）操作为”=“，表示字段值在目标中是否存在。<br />
						3）操作为”&gt;“，表示在目标中是否存在小于字段值的值。<br />
						4）操作为”&lt;“，表示在目标中是否存在大于字段值的值。<br />
						5）操作为"&lt;&gt;"，表示在目标中是否存在不等于字段值的值。<br />
					</td>
				</tr>
			</tbody>
		</table>
	</form>
	<div class="Footer"></div>
</div>
<script type="text/javascript" src="<%=CommonPath%>jquery/core.js"></script>
<script type="text/javascript" src="<%=CommonPath%>jquery/ui.js"></script>
<script type="text/javascript" src="<%=CommonPath%>xmldom.js"></script>
<script type="text/javascript" src="<%=CommonPath%>utility.js"></script>
<script type="text/javascript" src="<%=JsPath%>global.js"></script>
<script type="text/javascript" src="<%=ModuleJsPath%>module.js"></script>
</body>
</html>